<?php
/**
 *
 * @author henry
 * @version 
 */
require_once 'Zend/View/Interface.php';

/**
 * BaseUrl helper
 *
 * @uses viewHelper Zend_View_Helper
 */
class Zend_View_Helper_ContentType{
        
    public function contentType($data,$j) {
        $currentType = $data['content_type'][$j];
        $str = "";
        if ($currentType == 'varchar'){
            $value = isset($data['varchar_length'][$j])?$data['varchar_length'][$j]:"35";
            $varchar_unlimited_check = $data['varchar_unlimited'][$j]=='on'?"checked='checked'":"";
            $str = "Length: <input type='text' name='varchar_length[$j]' value='$value'> - <input $varchar_unlimited_check type='checkbox' name='varchar_unlimited[$j]'>Unlimited";
        }else if($currentType == 'enum' || $currentType == 'bool'){
            $str = "List: <input type='text' value='".$data['enum_type'][$j]."'  name='enum_type[$j]'> - Comma separated. Example: Male,Female.";
            if ($currentType == 'bool') $str .= "Note:if bool type have 2 item";
        }else if($currentType == 'int' || $currentType == 'double'){
            $number_unsigned_check = $data['number_unsigned'][$j]=='unsigned'?"checked='checked'":"";
            $str = " <input type='checkbox' $number_unsigned_check value='unsigned' name='number_unsigned[$j]'>Unsigned";
        }
        return $str;
    }
}

